package com.codeoss.framework.springsecurity;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import com.codeoss.module.res.model.ResUser;

public class JwtUser implements UserDetails{
	private ResUser resUser;
	private List<GrantedAuthority> roleGrantedAuthorityList;
	public JwtUser(ResUser resUser,List<GrantedAuthority> roleGrantedAuthorityList) {
		this.resUser=resUser;
		this.roleGrantedAuthorityList=roleGrantedAuthorityList;
	}
	
	@Override
	public Collection<? extends GrantedAuthority> getAuthorities() {
		// TODO Auto-generated method stub
		return roleGrantedAuthorityList;
	}

	@Override
	public String getPassword() {
		// TODO Auto-generated method stub
		return resUser.getPassword();
	}

	@Override
	public String getUsername() {
		// TODO Auto-generated method stub
		return resUser.getUsername();
	}

	@Override
	public boolean isAccountNonExpired() {
		// TODO Auto-generated method stub
		return true;
	}

	@Override
	public boolean isAccountNonLocked() {
		// TODO Auto-generated method stub
		return true;
	}

	@Override
	public boolean isCredentialsNonExpired() {
		// TODO Auto-generated method stub
		return true;
	}

	@Override
	public boolean isEnabled() {
		// TODO Auto-generated method stub
		return true;
	}

}
